package cn.cw.liyebao.web;

import cn.cw.liyebao.domain.TypeInfo;
import cn.cw.liyebao.service.SelectDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : caiwen
 * @date :2024/9/6
 * @Description
 */
@RestController
public class SelectDemo {
    @Autowired //自动注入注解。作用：就是让springboot框架帮你自动创建一个添加此注解的对象
    private SelectDemoService selectDemoService;


    @GetMapping("/getFirstTypeList")
    public List<TypeInfo> getFirstTypeList(){
        return selectDemoService.getFirstTypeList();
    }

    @GetMapping("/getSecondTypeList/{firstId}")
    public List<TypeInfo>  getSecondTypeList(@PathVariable Integer firstId){
        return selectDemoService.getSecondTypeList(firstId);
    }
}
